﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;

namespace OpenSoftStore.Client.UIL.ManagePrinter
{
    public partial class PrintWindow : Form
    {
        public PrintWindow()
        {
            InitializeComponent();
        }

        private void PrintWindow_Load(object sender, EventArgs e)
        {
            //this.rvPrint.RefreshReport();
        }

        public void SetReport(string reportEmbeddedResource,string dataSet,object data)
        {
            //rvPrint.r
            rvPrint.LocalReport.ReportEmbeddedResource = reportEmbeddedResource;
            ReportDataSource rds = new ReportDataSource(dataSet, data);
            rvPrint.LocalReport.DataSources.Clear();
            rvPrint.LocalReport.DataSources.Add(rds);
            //rvPrint.LocalReport.Refresh();
            rvPrint.RefreshReport();
        }

        private void pbClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
